﻿using AnjLab.SyncIT.Core.Api;

namespace AnjLab.SyncIT.Core.Data.Trac
{
    public class TracProvider : Provider
    {
        public override bool HasPassword
        {
            get { return true; }
        }

        public override string Icon
        {
            get { return @"resources\trac.ico"; }
        }

        public override ISourceTaskDao CreateTaskDao(Source source)
        {
            return new TracTicketDao(source);
        }


        public override string GetMyTasksUrl(Source source) {
            return source.ProjectBase + "/report/7";
        }

        public override string GetActiveTasksUrl(Source source) {
            return source.ProjectBase + "/report/1";
        }

        public override string GetProjectBaseHint(Source source)
        {
            return "Specify your Trac environment URL, e.g.: http://company.com/trac\nNote that the environment must have XML-RPC plugin installed and turned on";
        }

        public override string DefaultOutlookItemBodyTemplate
        {
            get
            {
                return
                    @"ticket : #ProjectBase#/ticket/#ID#
Reported by: #Reporter#
Assigned to: #Owner#
Priority: #Priority#
Milestone: #Milestone#
Component: #Component#
Version: #Version#
Description:
#RawDescription#
";
            }
        }
    }
}
